package com.test.fileapplication.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.test.fileapplication.R;

public class FileIconUtils {
    /**
     * 获取缩略图：URL
     */
    public static void getThumnailURL(Context mContext, RemoteFile remoteFile, ImageView imageView, boolean isBackup) {
        Glide.with(mContext).load("").diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.mipmap.file_icon_picture).transform(new GlideRoundTransform(mContext, 5)).into(imageView);
    }

    public static String getFileName(String fileName) {
        if (fileName.indexOf(".") > -1) {
            int lastIndex = fileName.lastIndexOf(".");
            return fileName.substring(0, lastIndex);
        } else {
            return fileName;
        }
    }
}
